package com.shuwen.cdp.track.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shuwen.cdp.track.entity.BaseUserEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserInfoMapper {

    @Select("select * from users where first_id = ${first_id} and project = ${project} limit 1")
    BaseUserEntity selectUserByFirstId(String first_id, String project);

    @Select("select * from users where second_id = ${second_id} and project = ${project} limit 1")
    BaseUserEntity selectUserBySecondId(String second_id, String project);

    @Update("alter table users update ${columns} where ${where}")
    int updateUserByInfo(String columns, String where);

    @Insert("insert into users (${columns}) values (${values})")
    int insertUserInfo(String columns, String values);
}
